﻿<Window x:Class="Weather.Windows.WeatherMedium"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Weather.Controls"
        xmlns:Properties="clr-namespace:Weather.Properties"
        Height="255" Width="180" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" FontWeight="Light"
        SourceInitialized="WindowSourceInitialized" Loaded="WindowLoaded" MouseMove="WindowMouseMove" MouseLeftButtonUp="WindowMouseLeftButtonUp" MouseEnter="ThisMouseEnter"
        MouseLeave="ThisMouseLeave">
    <Window.ContextMenu>
        <ContextMenu>
            <MenuItem Name="RefreshItem" Header="{x:Static Properties:Resources.Refresh}" Click="RefreshItemClick"/>
            <Separator />
            <MenuItem Name="PinItem" Header="{x:Static Properties:Resources.Pin}" IsCheckable="True" Click="PinItemClick"/>
            <MenuItem Name="TopMostItem" Header="{x:Static Properties:Resources.TopMost}" IsCheckable="True" Click="TopMostItemClick"/>
            <MenuItem Name="OptionsItem" Header="{x:Static Properties:Resources.OptionsItem}" Click="OptionsItemClick"/>
            <MenuItem Name="CloseItem" Header="{x:Static Properties:Resources.CloseItem}" Click="CloseItemClick"/>
        </ContextMenu>
    </Window.ContextMenu>
    <Window.RenderTransform>
        <ScaleTransform x:Name="Scale" ScaleX="1" ScaleY="{Binding ElementName=Scale, Path=ScaleX}"/>
    </Window.RenderTransform>
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo x:Name="Taskbar"/>
    </Window.TaskbarItemInfo>
    <Window.Resources>
        <Storyboard x:Key="ShowVideoAnim">
            <DoubleAnimation Storyboard.TargetName="MediaElement" Storyboard.TargetProperty="Opacity" From="-1" To="1" Duration="0:0:2.5"/>
            <DoubleAnimation Storyboard.TargetName="WeatherIcon" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:2.5" BeginTime="0:0:1.5"/>
        </Storyboard>
        <Storyboard x:Key="HideVideoAnim">
            <DoubleAnimation Storyboard.TargetName="MediaElement" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:2.5" Completed="DoubleAnimation_Completed"/>
            <DoubleAnimation Storyboard.TargetName="WeatherIcon" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:2.5"/>
        </Storyboard>
        <Storyboard x:Key="MouseEnter">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseEnterCompleted"/>
        </Storyboard>
        <Storyboard x:Key="MouseLeave">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseLeaveCompleted"/>
        </Storyboard>
    </Window.Resources>
    <Grid Margin="0,40,0,0">
        <Rectangle RadiusX="5" RadiusY="5" Stroke="#717171" Opacity="0.7">
            <Rectangle.Fill>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="#666666" Offset="0"/>
                    <GradientStop Color="#212121" Offset="0.7"/>
                    <GradientStop Color="#212121" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Border CornerRadius="5" Margin="1">
            <Border.Background>
                <VisualBrush>
                    <VisualBrush.Visual>
                        <MediaElement Name="MediaElement" LoadedBehavior="Manual" Stretch="UniformToFill" Opacity="0" MediaEnded="MediaElement_MediaEnded"/>
                    </VisualBrush.Visual>
                </VisualBrush>
            </Border.Background>
        </Border>
        <StackPanel Name="TempGrid" VerticalAlignment="Center" Margin="15,10,0,0" HorizontalAlignment="Left">
            <StackPanel.Effect>
                <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
            </StackPanel.Effect>
            <TextBlock Name="TemperatureTextBlock" Text="0°" Foreground="White" FontSize="40" Margin="0,0,0,-8"/>
            <TextBlock Name="TemperatureHLTextBlock" Text="0° / 0°" Foreground="White" FontSize="20"/>
        </StackPanel>
        <StackPanel Name="HWGrid" VerticalAlignment="Center" Margin="0,10,15,0" HorizontalAlignment="Right">
            <StackPanel Name="WindSpeedPanel" Orientation="Horizontal" HorizontalAlignment="Right">
                <Image Name="WindSpeedIcon" Source="/UIFramework.Weather;Component/Images/wind_lvl1.png" Width="42" Height="36" Margin="0,-10,-1,0" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Fill"/>
                <TextBlock Name="WindSpeedValueTextBlock" Foreground="White" Text="25 mph" FontSize="14">
                        <TextBlock.Effect>
                            <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" />
                        </TextBlock.Effect>
                </TextBlock>
            </StackPanel>
            <StackPanel Name="HumidityPanel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,-8,0,0">
                <Image Name="HumidityIcon" Source="/UIFramework.Weather;Component/Images/humidity_lvl1.png" Width="16" Height="16" Margin="0,-10,3,-10" RenderOptions.BitmapScalingMode="HighQuality"/>
                <TextBlock Name="HumidityValueTextBlock" Foreground="White" Text="75%" FontSize="14">
                        <TextBlock.Effect>
                            <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" />
                        </TextBlock.Effect>
                </TextBlock>
            </StackPanel>
        </StackPanel>
        <Image Name="WeatherIcon" Source="/UIFramework.Weather;Component/Images/weather_1.png" VerticalAlignment="Top" Margin="0,-40,0,0" Width="150"/>
        <TextBlock Name="SetupLocationTextBlock" Text="{x:Static Properties:Resources.SetupLocation}" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" Foreground="White" FontSize="22" Margin="5,0,5,0" Visibility="Collapsed">
           <TextBlock.Effect>
              <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
           </TextBlock.Effect>
        </TextBlock>
        <StackPanel Name="WeatherGrid" VerticalAlignment="Bottom" Margin="0,0,0,10">
            <TextBlock Name="LocationTextBlock" Text="New York" Foreground="White" FontSize="20" HorizontalAlignment="Center">
                <TextBlock.Effect>
                    <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
                </TextBlock.Effect>
            </TextBlock>
            <Rectangle Height="1" Fill="Black" Opacity="0.6" SnapsToDevicePixels="True">
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Color="#00000000" Offset="0"/>
                        <GradientStop Color="#00000000" Offset="0.1"/>
                        <GradientStop Color="#000000" Offset="0.5"/>
                        <GradientStop Color="#00000000" Offset="0.9"/>
                        <GradientStop Color="#00000000" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
            </Rectangle>
            <Rectangle Height="1" Fill="Gray" Opacity="0.6" SnapsToDevicePixels="True">
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Color="#00000000" Offset="0"/>
                        <GradientStop Color="#00000000" Offset="0.1"/>
                        <GradientStop Color="#000000" Offset="0.5"/>
                        <GradientStop Color="#00000000" Offset="0.9"/>
                        <GradientStop Color="#00000000" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
            </Rectangle>
            <TextBlock Name="WeatherTextBlock" Text="Clear" Foreground="White" FontSize="16" HorizontalAlignment="Center" Margin="5,0,5,0" TextTrimming="CharacterEllipsis">
                <TextBlock.Effect>
                    <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" Opacity="0.5"/>
                </TextBlock.Effect>
            </TextBlock>
        </StackPanel>
        <ProgressBar Name="WeatherRefreshProgressBar" Height="30" VerticalAlignment="Bottom" IsIndeterminate="True" Style="{StaticResource WeatherRefreshProgressBarStyle}" Foreground="White" Visibility="Collapsed"/>
    </Grid>
</Window>
